//
//  DataViewController.m
//  NineGroupProject
//
//  Created by dllo on 15/12/24.
//  Copyright © 2015年 lushan. All rights reserved.
//

#import "DataViewController.h"

@interface DataViewController ()<UIWebViewDelegate>



@end

@implementation DataViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 20 * HEI, WIDTH, HEIGHT - 20 * HEI)];
    self.webView.delegate = self;
    NSString *urlStr = [NSString stringWithFormat:@"http://www.xiangqu.com/detail?id=%@",self.productId];
    NSURL *url = [NSURL URLWithString:urlStr];
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    [self.webView loadRequest:request];
    [self.webView resignFirstResponder];
    [self.view addSubview:self.webView];
    
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    btn.frame = CGRectMake(0, 20, 30, 40);
    [self.view addSubview:btn];
    [btn addTarget:self action:@selector(btnAction:) forControlEvents:UIControlEventTouchUpInside];
    
//分享
//    self.btn = [UIButton buttonWithType:UIButtonTypeCustom];
//    self.btn.frame = CGRectMake(300 * WIDTH, 25 * HEIGHT, 25 * WIDTH, 25 * HEIGHT);
//    [self.view addSubview:self.btn];
//    [self.btn setImage:[UIImage imageNamed:@"iconfont-fenxiang-2.png"] forState:UIControlStateNormal];
//    [self.btn addTarget:self action:@selector(buttonAction:) forControlEvents:UIControlEventTouchUpInside];
    
}

-(void)btnAction: (UIButton *)btn{
    
    [self dismissViewControllerAnimated:YES completion:^{
        
        
    }];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
